package com.ss.android.video;

import android.content.Context;

import com.ss.android.common.lib.MobClickCombiner;
import com.ss.android.model.BaseArticle;

import org.json.JSONException;
import org.json.JSONObject;

public final class VideoEventReporter {
    private Context mContext;
    private BaseArticle mBaseArticle;
    private long adId;
    private String module;
    private long videoSubjectId;

    public VideoEventReporter(Context context) {
        this.mContext = context;
    }

    public final void onEvent(String arg10) {
        if (this.mBaseArticle != null && this.mBaseArticle.groupId > 0) {
            JSONObject jsonObject = new JSONObject();
            try {
                jsonObject.put("item_id", this.mBaseArticle.itemId);
                jsonObject.put("aggr_type", this.mBaseArticle.aggrType);
                jsonObject.put("video_subject_id", this.videoSubjectId);
            } catch (JSONException jsonException) {
            }
            MobClickCombiner.onEvent(this.mContext, this.module, arg10, this.mBaseArticle.groupId, this.adId, jsonObject);
        }
    }

    public final void setData(String module, BaseArticle baseArticle, long adId, long videoSubjectId) {
        this.module = module;
        this.mBaseArticle = baseArticle;
        this.adId = adId;
        this.videoSubjectId = videoSubjectId;
    }
}

